﻿using System;
using System.Collections.Generic;
using System.Text;

namespace He.API.WeiXin
{
    [Serializable]
    public class xml
    {
        // Fields
        private string _tousername;
        private string _fromusername;
        private string _createtime;
        private string _msgtype;
        private string _content;
        private string _picurl;
        private string _mediaid;
        private string _format;
        private string _thumbmediaid;
        private string _location_x;
        private string _location_y;
        private string _scale;
        private string _label;
        private string _title;
        private string _description;
        private string _url;
        private string _event;
        private string _eventkey;
        private string _ticket;
        private string _latitude;
        private string _longitude;
        private string _precision;
        private string _recognition;
        private string _msgid;
        private string _articlecount;
        private List<item> _articles;

        /// <summary>
        /// 接收者帐号（OpenID）
        /// </summary>
        public string ToUserName
        {
            get
            {
                return this._tousername;
            }
            set
            {
                this._tousername = value;
            }
        }
        /// <summary>
        /// 发送方帐号（OpenID）
        /// </summary>
        public string FromUserName
        {
            get
            {
                return this._fromusername;
            }
            set
            {
                this._fromusername = value;
            }
        }
        /// <summary>
        /// 消息创建时间 （整型）
        /// </summary>
        public string CreateTime
        {
            get
            {
                return this._createtime;
            }
            set
            {
                this._createtime = value;
            }
        }
        /// <summary>
        /// 信息类型
        /// </summary>
        public string MsgType
        {
            get
            {
                return this._msgtype;
            }
            set
            {
                this._msgtype = value;
            }
        }
        /// <summary>
        /// 文本消息内容
        /// </summary>
        public string Content
        {
            get
            {
                return this._content;
            }
            set
            {
                this._content = value;
            }
        }
        /// <summary>
        /// 图片链接
        /// </summary>
        public string PicUrl
        {
            get
            {
                return this._picurl;
            }
            set
            {
                this._picurl = value;
            }
        }
        /// <summary>
        /// 图片消息媒体id，可以调用多媒体文件下载接口拉取数据。
        /// </summary>
        public string MediaId
        {
            get
            {
                return this._mediaid;
            }
            set
            {
                this._mediaid = value;
            }
        }
        /// <summary>
        /// 语音格式，如amr，speex等
        /// </summary>
        public string Format
        {
            get
            {
                return this._format;
            }
            set
            {
                this._format = value;
            }
        }
        /// <summary>
        /// 视频消息缩略图的媒体id，可以调用多媒体文件下载接口拉取数据。
        /// </summary>
        public string ThumbMediaId
        {
            get
            {
                return this._thumbmediaid;
            }
            set
            {
                this._thumbmediaid = value;
            }
        }
        /// <summary>
        /// 地理位置纬度
        /// </summary>
        public string Location_X
        {
            get
            {
                return this._location_x;
            }
            set
            {
                this._location_x = value;
            }
        }
        /// <summary>
        /// 地理位置经度
        /// </summary>
        public string Location_Y
        {
            get
            {
                return this._location_y;
            }
            set
            {
                this._location_y = value;
            }
        }
        /// <summary>
        /// 地图缩放大小
        /// </summary>
        public string Scale
        {
            get
            {
                return this._scale;
            }
            set
            {
                this._scale = value;
            }
        }
        /// <summary>
        /// 地理位置信息
        /// </summary>
        public string Label
        {
            get
            {
                return this._label;
            }
            set
            {
                this._label = value;
            }
        }
        /// <summary>
        /// 消息标题
        /// </summary>
        public string Title
        {
            get
            {
                return this._title;
            }
            set
            {
                this._title = value;
            }
        }
        /// <summary>
        /// 消息描述
        /// </summary>
        public string Description
        {
            get
            {
                return this._description;
            }
            set
            {
                this._description = value;
            }
        }
        /// <summary>
        /// 消息链接
        /// </summary>
        public string Url
        {
            get
            {
                return this._url;
            }
            set
            {
                this._url = value;
            }
        }
        /// <summary>
        /// 事件类型，subscribe(订阅)、unsubscribe(取消订阅)
        /// </summary>
        public string Event
        {
            get
            {
                return this._event;
            }
            set
            {
                this._event = value;
            }
        }
        /// <summary>
        /// 事件KEY值，qrscene_为前缀，后面为二维码的参数值
        /// </summary>
        public string EventKey
        {
            get
            {
                return this._eventkey;
            }
            set
            {
                this._eventkey = value;
            }
        }
        /// <summary>
        /// 二维码的ticket，可用来换取二维码图片
        /// </summary>
        public string Ticket
        {
            get
            {
                return this._ticket;
            }
            set
            {
                this._ticket = value;
            }
        }
        /// <summary>
        /// 地理位置纬度
        /// </summary>
        public string Latitude
        {
            get
            {
                return this._latitude;
            }
            set
            {
                this._latitude = value;
            }
        }
        /// <summary>
        /// 地理位置经度
        /// </summary>
        public string Longitude
        {
            get
            {
                return this._longitude;
            }
            set
            {
                this._longitude = value;
            }
        }
        /// <summary>
        /// 地理位置精度
        /// </summary>
        public string Precision
        {
            get
            {
                return this._precision;
            }
            set
            {
                this._precision = value;
            }
        }
        /// <summary>
        /// 语音识别结果，UTF8编码
        /// </summary>
        public string Recognition
        {
            get
            {
                return this._recognition;
            }
            set
            {
                this._recognition = value;
            }
        }
        /// <summary>
        /// 消息id，64位整型
        /// </summary>
        /// <returns></returns>
        public string MsgId
        {
            get
            {
                return this._msgid;
            }
            set
            {
                this._msgid = value;
            }
        }

        /// <summary>
        /// 图文消息个数，限制为10条以内
        /// </summary>
        public string ArticleCount
        {
            get
            {
                return this._articlecount;
            }
            set
            {
                this._articlecount = value;
            }
        }

        public List<item> Articles
        {
            get
            {
                return this._articles;
            }
            set
            {
                this._articles = value;
            }
        }

        public class item
        {
            private string _title;
            private string _description;
            private string _picurl;
            private string _url;

            /// <summary>
            /// 图文消息标题
            /// </summary>
            public string Title
            {
                get
                {
                    return this._title;
                }
                set
                {
                    this._title = value;
                }
            }
            /// <summary>
            /// 图文消息描述
            /// </summary>
            public string Description
            {
                get
                {
                    return this._description;
                }
                set
                {
                    this._description = value;
                }
            }

            /// <summary>
            /// 图片链接，支持JPG、PNG格式，较好的效果为大图360*200，小图200*200
            /// </summary>
            public string PicUrl
            {
                get
                {
                    return this._picurl;
                }
                set
                {
                    this._picurl = value;
                }
            }

            /// <summary>
            /// 点击图文消息跳转链接
            /// </summary>
            public string Url
            {
                get
                {
                    return this._url;
                }
                set
                {
                    this._url = value;
                }
            }
        }
    }
}
